﻿using System;

using BizElements.BusinessLayer;

namespace BizElements.Web
{
    /// <summary>
    /// Indicates which actions have caused the <see cref="ISearchFilter.FilterCommand"/> to be raised.
    /// </summary>
    [Flags]
    public enum SearchFilterCommands : long
    {
        #region Supported actions.

        /// <summary>
        /// Indicates that the state of the filter of the <see cref="ISearchEngine"/> 
        /// manipulated by the <see cref="ISearchFilter"/> has changed.
        /// </summary>
        /// <remarks>Commonly combined with <b>Search</b> action.</remarks>
        FilterStateChanged = 1,

        /// <summary>
        /// Indicates that a client should perform a <b>search</b> operation which uses the provided filter.
        /// </summary>
        Search = 2,

        /// <summary>
        /// Indicates that the values of all <see cref="ISearchEngine.SearchFields"/> have been reset.
        /// </summary>
        /// <remarks>Commonly combined with <b>FilterStateChanged</b> and <b>Search</b> actions.</remarks>
        Reset = 4,

        /// <summary>
        /// Indicates that a client should persist the current filter state in the current actor's filter store.
        /// </summary>
        SaveFilterForActor = 8,

        /// <summary>
        /// Indicates that a client should look for filters persisted in the current actor's filter store that 
        /// are compatibile with the current <see cref="ISearchFilter"/> and optionally offer UI to manage them.
        /// </summary>
        FindOrManageFiltersForActor = 16,

        /// <summary>
        /// Indicates that a client shoult look for predefined filters persisted in the application store 
        /// that are compatibile with the current <see cref="ISearchFilter"/>.
        /// </summary>
        FindPredefinedFilter = 32,

        #endregion
    }
}